package com.finace.money.ui.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.finace.money.ui.fragment.BaseFragment;

import java.util.List;


/**
 * Created by zhangpeng on 2017/12/1.
 */

public class KViewFragmenAdapter extends FragmentPagerAdapter {

    private List<BaseFragment> mDatas;

    public KViewFragmenAdapter(FragmentManager fm, List<BaseFragment> datas) {
        super(fm);
        this.mDatas = datas;
    }

    @Override
    public Fragment getItem(int position) {
        return mDatas.get(position);
    }

    @Override
    public int getCount() {
        return (null != mDatas && mDatas.size() > 0) ? mDatas.size() : 0;
    }
}
